﻿using System;
using System.Collections.Generic;
using System.Text;

namespace TSVNAddin.SVN
{
	public class RootPathBuilder
	{
		public virtual string BuildRoot(string path, Uri repositoryUri, Uri pathUri)
		{
			if (repositoryUri == pathUri)
				return path.ToLower();

			string relativeUri = pathUri.ToString().Replace(repositoryUri.ToString(), string.Empty);
			string relativePath = relativeUri.Replace('/', '\\');
			string workingRoot = path.ToLower().Replace(relativePath.ToLower(), string.Empty);

			return workingRoot;
		}
	}
}
